﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="editor.aspx.cs" Inherits="GDIT.page.manage.content.editor" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑器</title>
    <link href="../../../Admin/fckeditor/WordPaster/css/WordPaster.css" rel="stylesheet" type="text/css" />
    <link href="../../../Admin/fckeditor/WordPaster/css/ui-lightness/jquery-ui-1.8.11.custom.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/m_editor.css" rel="stylesheet" type="text/css" />
    <script src="../../../Admin/fckeditor/kindeditor-min.js" type="text/javascript"></script>
    <script src="../../../Admin/fckeditor/WordPaster/js/jquery.min.js" type="text/javascript"></script>
    <script src="../../../Admin/fckeditor/WordPaster/js/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
    <script src="../../../Admin/fckeditor/WordPaster/js/WordPaster.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div class="all">




<div class="gray">
    <div class="editor center">
        <!--这里放编辑器，大小要设100%-->
        <textarea id="content1" name="content1" runat="server" style="width:750px;height:700px;visibility:hidden;"></textarea>
	<script type="text/javascript">
	    var pasterMgr = new PasterManager();
	    //修改访问ckeditor的路径
	    pasterMgr.Config["PostUrl"] = "<%=url %>";
	    pasterMgr.Load(); //

	    //加载kindeditor
	    KE.show({
	        id: 'content1'
	        , cssPath: './index.css'
			, items: ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', 'imagepaster', 'excelpaster', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', '|', 'selectall', '-',
'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
'flash', 'media', 'advtable', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']
    		, afterCreate: function (id) {
    		    //初始化
    		    pasterMgr.Init(id);
    		}
	    });
	</script>
    </div>
</div>



<div class="information">
    <div class="center">
        <div>短标题：&ensp;&ensp;<asp:TextBox ID="txtTitle" runat="server" CssClass="title"></asp:TextBox></div>
        <div>
            <%--<asp:LinkButton ID="btnPublish" runat="server" class="publish" onclick="btnPublish_Click">发 布</asp:LinkButton>--%>
            <asp:Button ID="btnPublish" runat="server" CssClass="publish" Text="发 布"  
                OnClick="btnPublish_Click" BorderStyle="None"/>
        </div>
        <div><%--<asp:LinkButton ID="btnEdit" runat="server" class="edit" onclick="btnEdit_Click">保 存</asp:LinkButton>--%>
            <asp:Button ID="btnEdit" runat="server" CssClass="edit" Text="保 存"  
                OnClick="btnEdit_Click" BorderStyle="None"/>
        </div>
    </div>
</div>


<div>
    <asp:TextBox ID="txtId" runat="server" CssClass="id"></asp:TextBox>
    <asp:TextBox ID="txtType" runat="server" CssClass="type"></asp:TextBox>
</div>

<script type="text/javascript">
    function Ready() {
        var txtId; //文章id
        var txtType; //文章类型
        var ddlType; //类型列表
        var btnPublish; //发布按钮
        var btnEdit; //保存按钮
        var allEvents = document.getElementsByTagName("*");
        for (var i = 0; i < allEvents.length; i++) {
            if (allEvents[i].className == "id") {
                txtId = allEvents[i];
            } else if (allEvents[i].className == "type") {
                txtType = allEvents[i];
            } else if (allEvents[i].className == "types") {
                ddlType = allEvents[i];
            } else if (allEvents[i].className == "publish") {
                btnPublish = allEvents[i];
            } else if (allEvents[i].className == "edit") {
                btnEdit = allEvents[i];
            }
        }
        txtId.parentNode.style.display = "none";
        if (txtType.value == "") {
            btnEdit.parentNode.style.display = "none";
        } else {
            ddlType.parentNode.style.display = "none";
            btnPublish.parentNode.style.display = "none";
        }
    }

    Ready();

</script>




</div>
</form>
</body>
</html>
